<template>
	<view class="container">
		<block v-if="listData.length == 0">
			<view class="all_empty">
				<u-empty mode="data"></u-empty>
			</view>
		</block>
		<block v-else>
			<u-cell-group>
				<block v-for="(item,index) in listData" :key="index">
					<u-cell :label="'推荐时间：'+$u.timeFormat(item.recommend_time * 1000, 'yyyy年mm月dd日 hh时MM分ss秒')">
						<view slot="title">
							用户名:{{item.name}}
						</view>
					</u-cell>
				</block>
				
			</u-cell-group>
		</block>
	</view>
</template>

<script>
export default {
	data() {
		return {
			searchForm: {
				limit: 10,
				page: 1
			},
			listData: []
		};
	},
	onLoad() {
		this.$initConfig().then((_) => {
			this.getInfo();
		});
	},
	methods: {
		getInfo(is_add = false) {
			const _this = this;
			_this
				.$http('crop/getRecommendUserList', {
					..._this.searchForm
				})
				.then((res) => {
					if (is_add) {
						_this.listData = _this.listData.concat(res.data.data);
					} else {
						_this.listData = res.data.data;
					}
					if (_this.listData.length >= res.data.total) {
						this.status = 'nomore';
					} else {
						this.status = 'loadmore';
					}
				});
		}
	}
};
</script>

<style></style>
